package ImageInterface.Homework;

import javax.swing.JFrame;
import java.awt.FlowLayout;
import javax.swing.JButton;

public class Homework1 {
    public static void main(String[] args) {
        JFrame frame = new JFrame("流式布局器");
        FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 10, 10);
        frame.setLayout(f1);
        for (int i = 1; i <= 5; i++) {
            frame.add(new JButton("按钮" + i));
        }
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(300,250);
        frame.setVisible(true);
    }
}
